﻿using Autofac;
using Service.Core;
using Service.Inferface;
using System;
using System.Collections.Generic;
using System.Text;

namespace Service.Config
{
    public static class ServiceConfig
    {
        private static Buider buider;
        private static object obj = new object();
        public static Buider Buider
        {
            get
            {
                lock (obj)
                {
                    if (buider == null)
                    {
                        buider = new Buider();
                    }
                    return buider;
                }
            }
        }

        public static Buider InitIoc(this Buider buider, ContainerBuilder containerBuilder)
        {
            containerBuilder.RegisterType<UserService>().As<IUserService>();
            containerBuilder.RegisterType<MenuService>().As<IMenuService>().PropertiesAutowired();
            return buider;
        }
    }
    public class Buider
    {

    }
}
